#pragma once
#include "EXSpinButtonCtrl.h"
#include "EXDateTimeCtrlResSet.h"
// CEXDateTimeCtrl

class AFX_EXT_CLASS CEXDateTimeCtrl : public CDateTimeCtrl
{
	DECLARE_DYNAMIC(CEXDateTimeCtrl)

public:
  enum DATETIME_STYLE
  {
    NOIMAGE,
    DATETIME_CTRL = 23,
  };

	CEXDateTimeCtrl();
	virtual ~CEXDateTimeCtrl();

	BOOL SetBitmaps(UINT nBkgndID, UINT nSpinBkgndID, UINT nUpID, UINT nDownID,
		              int nCount, COLORREF crBkgnd, int nTopHeight = 0, 
                  int nBottomHeight = 0,int nLeftWidth = 0,int nRightWidth = 0);
	BOOL InitBgBitmap(CBitmap & src, int index, int count);
	void DrawFrame(CDC * pDC);

  void SetResSet(CEXBaseResSet* pResSet);
  CEXDateTimeCtrlResSet* m_pDTResSet;
	enum STATUS
	{
		normal,
		focus,
		select,
		disable
	};

	BOOL m_bSetBitmap;

	int m_nTopHeight;
	int m_nBottomHeight;
	int m_nLeftWidth;
	int m_nRightWidth;
	UINT m_nBkgndID;
	int m_nNumOfBgPics;
	COLORREF m_crBkgnd;
	CBitmap m_bmpBkgnd;

	UINT m_nSpinBkgndID;
	UINT m_nUpID;
	UINT m_nDownID;
	CEXSpinButtonCtrl * m_pSpinButtonCtrl;

	BOOL m_bFocus;

protected:
	DECLARE_MESSAGE_MAP()
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	virtual void PreSubclassWindow();
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseLeaveNotify(WPARAM w, LPARAM l);
};


